#include "dialog.h"
#include "ui_dialog.h"

Dialog::Dialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Dialog)
{
    ui->setupUi(this);
    time(&startTime);
//    fd = open("FIFO.tmp",O_WRONLY, 0);
    connect(&timer, SIGNAL(timeout()), this, SLOT(printRuntime()));
    timer.start();
}

Dialog::~Dialog()
{
    delete ui;
}

void Dialog::printRuntime()
{
    int i=1;
//    read(fd, &i, sizeof(int));
    if(i!=0)
    {
        time(&currentTime);
        ui->label->setText("It has run for: "+QString::number(currentTime-startTime, 10)+"s");
    }
}
